import { PropsWithChildren } from 'react';
import { useEffect, FC, useState, useRef } from 'react';
import { View } from '@tarojs/components'
import './index.less'
import { useDispatch, useSelector } from 'react-redux';
import { useSetState } from '@hooks/index.ts'
import AccountManage from '@components/accountManage'

const defaultUserInfo = {
  phone: '',
  code: ''
}

type UserInfoType = {
  phone: string | number,
  code: string | number,
}

const Index: FC<PropsWithChildren> = () => {
  // dispatch({ type: 'count/add', payload: 1 });
  const dispatch = useDispatch();
  const { count } = useSelector((store: any) => {
    return store.counter;
  });
  const [userInfo, setUserInfo] = useSetState<UserInfoType>(defaultUserInfo)

  useEffect(() => {
    // 任何你需要在组件挂载时执行的副作用
  }, []);

  return (
    <View className="my-accountManage">
      <AccountManage />
    </View>
  );
};

export default Index;
